from openpyxl import load_workbook

class Tools():
    #初始化
    def __init__(self,path,sheetname):
        self.path=load_workbook(path)
        self.sheetname=self.path[sheetname]

    #方法
    def getdate(self):
        dalist=[]
        for line in self.sheetname:
            list=[]
            list.append(line[0].value)
            list.append(line[1].value)
            list.append(line[2].value)
            dalist.append(list)

        dalist.pop(0)
        return dalist

#执行
if __name__ == '__main__':
    path=r"C:\Users\HP\Desktop\A3mall_login.xlsx"
    sheetname='Sheet1'
    #断言
    dy=Tools(path,sheetname)
    print(dy.getdate())